﻿@model Gfw.Web.Models.User.UserBindingInfoModel
@{
    ViewBag.Title = "新增绑定信息";
    Layout = "~/Views/Shared/_LayoutContent.cshtml";
}

<h2 style="color: #f00">注：绑定信息保存后不可更改！！！若需要更改，请联系客服。</h2>

@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>新增绑定信息</legend>

        @Html.HiddenFor(model => model.LoginName)

        <div class="editor-label">
            @Html.LabelFor(model => model.IDCard)
        </div>
        <div class="editor-field">
            @{
    if (string.IsNullOrWhiteSpace(Model.IDCard))
    {
                @Html.TextBoxFor(model => model.IDCard)
    }
    else
    {
                @Html.HiddenFor(model => model.IDCard)
                @Html.DisplayFor(model => model.ShowIDCard)
    }
            }
            @Html.ValidationMessageFor(model => model.IDCard)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.BankName)
        </div>
        <div class="editor-field">
            @{
    if (string.IsNullOrWhiteSpace(Model.BankName))
    {
                @Html.DropDownListFor(model => model.BankName, ViewBag.BankList as IEnumerable<SelectListItem>, "")
    }
    else
    {
                @Html.HiddenFor(model => model.BankName)
                @Html.DropDownListFor(model => model.BankName, ViewBag.BankList as IEnumerable<SelectListItem>, new { disabled = "disabled", @readonly = "readonly" })
    }
            }
            @Html.ValidationMessageFor(model => model.BankName)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.BankCardNo)
        </div>
        <div class="editor-field">
            @{
    if (string.IsNullOrWhiteSpace(Model.BankCardNo))
    {
                @Html.TextBoxFor(model => model.BankCardNo)
    }
    else
    {
                @Html.HiddenFor(model => model.BankCardNo)
                @Html.DisplayFor(model => model.ShowBankCardNo)
    }
            }
            @Html.ValidationMessageFor(model => model.BankCardNo)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.BankUserName)
        </div>
        <div class="editor-field">
            @{
    if (string.IsNullOrWhiteSpace(Model.BankUserName))
    {
                @Html.TextBoxFor(model => model.BankUserName)
                <span style="color: Red; font-weight: bold">（必填）</span>
    }
    else
    {
                @Html.HiddenFor(model => model.BankUserName)
                @Html.DisplayFor(model => model.ShowBankUserName)
    }
            }
            @Html.ValidationMessageFor(model => model.BankUserName)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.BankAddress)
        </div>
        <div class="editor-field">
            @{
    if (string.IsNullOrWhiteSpace(Model.BankAddress))
    {
                @Html.TextBoxFor(model => model.BankAddress)
    }
    else
    {
                @Html.HiddenFor(model => model.BankAddress)
                @Html.DisplayFor(model => model.ShowBankAddress)
    }
            }
            @Html.ValidationMessageFor(model => model.BankAddress)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Tenpay)
        </div>
        <div class="editor-field">
            @{
    if (string.IsNullOrWhiteSpace(Model.Tenpay))
    {
                @Html.TextBoxFor(model => model.Tenpay)
    }
    else
    {
                @Html.HiddenFor(model => model.Tenpay)
                @Html.DisplayFor(model => model.ShowTenpay)
    }
            }
            @Html.ValidationMessageFor(model => model.Tenpay)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Alipay)
        </div>
        <div class="editor-field">
            @{
    if (string.IsNullOrWhiteSpace(Model.Alipay))
    {
                @Html.TextBoxFor(model => model.Alipay)
    }
    else
    {
                @Html.HiddenFor(model => model.Alipay)
                @Html.DisplayFor(model => model.ShowAlipay)
    }
            }
            @Html.ValidationMessageFor(model => model.Alipay)
        </div>

        <p>
            @{
    if (string.IsNullOrWhiteSpace(Model.IDCard) ||
        string.IsNullOrWhiteSpace(Model.BankName) ||
        string.IsNullOrWhiteSpace(Model.BankCardNo) ||
        string.IsNullOrWhiteSpace(Model.BankUserName) ||
        string.IsNullOrWhiteSpace(Model.BankAddress) ||
        string.IsNullOrWhiteSpace(Model.Tenpay) ||
        string.IsNullOrWhiteSpace(Model.Alipay))
    {
                <input type="submit" value="确认修改" />
    }
            }
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("返回首页", "Index", "Default")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
